
# 双指针法， 删除有序列表里的重复元素 对应leetcode 26. 删除有序数组中的重复项 https://leetcode-cn.com/problems/remove-duplicates-from-sorted-array/
class Solution:
    def removeDuplicates(self, nums: List[int]) -> int:
        length = len(nums)
        slow,fast = 1,1
        while fast < length:
            if nums[fast] != nums[fast-1]:
                nums[slow] = nums[fast]
                slow += 1
            fast += 1

        return slow